LocaleListCompat

Helper for accessing features in LocaleList.

Functions

Link copied to clipboard
Creates a new instance of LocaleListCompat from the Locale array.
Link copied to clipboard
open fun equals(other: Any): Boolean
Link copied to clipboard
Generates a new LocaleList with the given language tags.
Link copied to clipboard
open fun get(index: Int): Locale
Retrieves the Locale at the specified index.
Link copied to clipboard
Returns the default locale list, adjusted by moving the default locale to its first position.
Link copied to clipboard
The result is guaranteed to include the default Locale returned by Locale.getDefault(), but not necessarily at the top of the list.
Link copied to clipboard
Retrieve an empty instance of LocaleListCompat.
Link copied to clipboard
open fun getFirstMatch(@NonNull supportedLocales: Array<String>): Locale
Returns the first match in the locale list given an unordered array of supported locales in BCP 47 format.
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
@IntRange(from = "-1")
open fun indexOf(@Nullable locale: Locale): Int
Searches this LocaleListCompat for the specified Locale and returns the index of the first occurrence.
Link copied to clipboard
open fun isEmpty(): Boolean
Returns whether the LocaleListCompat contains no Locale items.
Link copied to clipboard
@RequiresApi(value = 21)
open fun matchesLanguageAndScript(@NonNull supported: Locale, @NonNull desired: Locale): Boolean
Determine whether two locales are considered a match, even if they are not exactly equal.
Link copied to clipboard
@IntRange(from = 0)
open fun size(): Int
Returns the number of Locale items in this LocaleListCompat.
Link copied to clipboard
Retrieves a String representation of the language tags in this list.
Link copied to clipboard
open fun toString(): String
Link copied to clipboard
open fun unwrap(): Any
Gets the underlying framework object.
Link copied to clipboard
@RequiresApi(value = 24)
open fun wrap(@NonNull localeList: LocaleList): LocaleListCompat
Creates a new instance of LocaleListCompat from the Locale list.
@RequiresApi(value = 24)
open fun wrap(localeList: Any): LocaleListCompat